var app = getApp();

Component({
        properties: {
                textOne: {
                        type: String
                },
                inMenuItemData: {
                        type: Array
                }
        },

        data: {
                baseUrl: app.globalData.baseUrl,
                selectFuncId: app.globalData.selectFuncId,
                listData: [
                        {
                                id: "box",
                                title: "范式盲盒",
                                normalImageUrl: "/boxIndex/right-box-img-unselect.png",
                                selectImageUrl: "/boxIndex/right-box-img.png",
                                titleUrl: "/boxIndex/right-box-text.png",
                                navigateUrl: "/pages/magicBox/boxIndex/boxIndex"
                        }, {
                                id: "space",
                                title: "灵感空间",
                                normalImageUrl: "/boxIndex/right-space-img-unselect.png",
                                selectImageUrl: "/boxIndex/right-space-img.png",
                                titleUrl: "/boxIndex/right-space-text.png",
                                navigateUrl: "/pages/inspirationSpace/spaceIndex/spaceIndex"

                        }, {
                                id: "wardrobe",
                                title: "我的衣柜",
                                normalImageUrl: "/boxIndex/right-wardrobe-img-unselect.png",
                                selectImageUrl: "/boxIndex/right-wardrobe-img.png",
                                titleUrl: "/boxIndex/right-wardrobe-text.png",
                                navigateUrl: "/pages/myWardrobe/wardrobeIndex/wardrobeIndex"
                        }
                ]
        },

        attached() {
                this.setData({
                        selectFuncId: app.globalData.selectFuncId
                })
        },

        methods: {
                tabItemClick(e) {
                        console.log(e.currentTarget.dataset.data);
                        let tempid = e.currentTarget.dataset.data.id;
                        if(tempid == this.data.selectFuncId)
                                return;
                        
                        this.setData({
                                selectFuncId: tempid
                        })
                        app.globalData.selectFuncId = tempid;
                        jd.navigateTo({
                                url:e.currentTarget.dataset.data.navigateUrl
                        })
                },

                startFrameAni() {
                        // frame ani
                        // end ani
                },

                animationEndFun() {

                }
        },
})